package com.tanhua.manage.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.tanhua.manage.domain.AnalysisByDay;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

@Mapper
public interface AnalysisByDayMapper extends BaseMapper<AnalysisByDay> {

    @Select("SELECT SUM(num_registered) FROM tb_analysis_by_day")
    Long queryCumulativeUsers();

    @Select("SELECT SUM(num_active) FROM tb_analysis_by_day WHERE record_date BETWEEN #{lastDate} AND #{currDate}")
    Long queryNumActiveByDate(@Param("lastDate") String lastDate, @Param("currDate") String currDate);
}
